//Base class for all controls
function Control(node) {
    this.node = node;
/*    if (node != null) {
        this.node.jsObject = this;
    }*/
    this.properties = {"node":node};
    this.properties.getString = function (name, autoPrefix) {
        if (!Utils.isDefined(autoPrefix)){
            autoPrefix = true;
        }
                
        name=autoPrefix?"coreimsee:"+name:name;
        
        if (node != null) {
            return this.node.getAttribute(name);        
        }
        
        return null;
    } 
    
    this.properties.getObject = function (name, autoPrefix) {        
        var str = this.getString(name, autoPrefix);
        return eval(str);
    } 
    
       
}


Control.prototype.setEnabled = function (enabled) {
    this.enabled = enabled;
    this.setNodeEnabled(this.node, enabled);
}

Control.prototype.setNodeEnabled = function (node, enabled) {
    if (Utils.isDefined(node["disabled"])) node["disabled"]=!enabled;
    for (var i=0; i<node.childNodes.length; i++){
        this.setNodeEnabled(node.childNodes[i], enabled);
    }
}

Control.prototype.isEnabled = function () {
    if (Utils.isDefined(this.enabled))
        return this.enabled;
    if (Utils.isDefined(this.node["disabled"]))
        return !this.node["disabled"];    
    return false;    
}


Control.prototype.findByName = function (name) {
    try {
        return eval(name);
    } catch (e) {
        return null;
    }
}